package com.jianxiu.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
    public static final String FULL_TIME = "yyyy-MM-dd HH:mm:ss";

    public static final SimpleDateFormat forDate = new SimpleDateFormat("yyyy-MM-dd");
    public static final SimpleDateFormat forTime = new SimpleDateFormat("yyyyMMddhhmmssSSS");

    public static String formatDate(Date date) {
        return forDate.format(date);
    }

    public static String formatTime(Date date) {
        return forTime.format(date);
    }

    public static String formatTime(Date date, String format) {
        SimpleDateFormat forTime = new SimpleDateFormat(format);
        return forTime.format(date);
    }

}
